namespace GomuLibrary.IO.DiscImage
{
    using System;
    using System.Runtime.InteropServices;

    [StructLayout(LayoutKind.Sequential)]
    public struct RecordEntryInfo
    {
        public uint Extent;
        public uint Size;
        public byte[] Date;
        public string Name;
        public string FullPath;
        public bool Directory;
        public bool Hidden;
        public RecordEntryInfo(uint extent, uint size, byte[] date, string name, string fullPath, bool hidden, bool directory)
        {
            this.Extent = extent;
            this.Size = size;
            this.Date = date;
            this.Name = name;
            this.FullPath = fullPath;
            this.Hidden = hidden;
            this.Directory = directory;
        }

        public DateTime GetDate() => 
            new DateTime(this.Date[0] + 0x76c, this.Date[1], this.Date[2], this.Date[3], this.Date[4], this.Date[5], DateTimeKind.Utc);
    }
}

